<template>
	<view>
		<div class='tips'>
			在线登录设备
		</div>
		<div class='setBox'>
			<div class='user-box'>
				<u-icon label="佩奇" labelSize='18' size="40" name="../../../static/image/Myicon/phone.png"></u-icon>
				<span class='color'>(当前设备)</span>
			</div>
			<div class='user-phone'>
				<view class="particulars">
					设备类型：{{deviceModel}}
				</view>
				<view class="particulars">
					最近登录：{{strDate}}
				</view>
			</div>
		</div>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				deviceModel:null,
				logtime:null,
				strDate:''
			}
		},
		onLoad() {
			this.logtime = uni.getStorageSync("logoTime");
			this.getTime(this.logtime)	
			let _that = this;
			uni.getSystemInfo({
				success: function (res) {
					_that.deviceModel = res.deviceModel
				}
			});
		},
		methods:{
			getTime(time){
				let date = new Date(time);
				let Y = date.getFullYear() + '-';
				let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
				let h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
				let m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
				let s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
				this.strDate = Y + M + D + h + m + s;
			}
		}
		
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #F4F4F4;
	}
	.tips{
		padding: 40upx;
		font-size: 26upx;
		color: #999999;
	}
	.setBox{
		background-color: #fff;
		padding: 30upx 40upx;
		.user-box{
			display: flex;
			align-items: center;
			.color{
				margin-left: 30upx;
				color: #27D1D5 ;
			}
		}
		.user-phone{
			margin-top: 30upx;
			.particulars{
				font-size: 28upx;
				color: #999999;
				margin: 10upx 0;
				display: flex;
			}
		}
		
	}
</style>